﻿using MassTransit;
using MQHelper.RabbitMQ;
using System;
using System.Collections.Generic;
using System.Security.Authentication;
using System.Text;
using System.Threading.Tasks;

namespace TestProject
{
    class Program
    {
        static async Task Main(string[] args)
        {
            //await MqttLibTest.Test("192.168.163.128", 1883, "admin", "public");// "admin", "public"
            //await MqttLibTest.TestServerAndClient();
            //var sumary = BenchmarkDotNet.Running.BenchmarkRunner.Run<ToolSetTest>();

            Dictionary<string, Action<MassTransit.IReceiveEndpointConfigurator>> dic = new Dictionary<string, Action<MassTransit.IReceiveEndpointConfigurator>>
            {
                { "testQueue", (conf) => { conf.Consumer<MessageBus.MsgConsumer>();} }
            };

            MessageBus.MessageBusClient client = new MessageBus.MessageBusClient(
                MessageBus.Const.BrokerType.RabbitMQ,
                new MessageBus.BrokerInfo
                {
                    IP = "127.0.0.1",
                    Port = 5672,
                    User = "guest",
                    Pwd = "111111"
                },
                dic);
            await client.StartAsync();
            bool rs = await client.SendAsync("testQueue", new MessageBus.Msg { Text = "汉字随便测试" });

            Console.ReadLine();
        }

    }
}
